﻿/**
 * Display
 * 
 * @version 2012.01.27
 * @author  Bruno Miguel de Oliveira Tamer <bmotamer@gmail.com>
 */

#region C# Libraries

using System.Collections.Generic;

#endregion

#region XNA Libraries

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

#endregion

#region SDK Libraries

using main.sdk.display.object2d;

#endregion

namespace main.sdk.display
{

    public static class Display
    {

        #region Static Variables

        public static Color Color = Color.Black;

        public static readonly List<Viewport2D> Viewport2D = new List<Viewport2D>();

        #endregion

        #region Add / Remove 2D

        public static void AddViewport2D(Viewport2D child) { Viewport2D.Add(child); }

        public static void RemoveViewport2D(Viewport2D child) { Viewport2D.Remove(child); }

        #endregion

        #region Drawing

        public static void Draw()
        {
            Program.Self.GraphicsDevice.Clear(Color);
            foreach (Viewport2D viewport2D in Viewport2D)
                if (viewport2D.Visible)
                    viewport2D.Draw();
        }

        #endregion

    }

}